// 渲染首屏
import createApp from "./app";

/**
 * context 是从 nodejs 服务端获取到浏览器访问的首页
 */
export default context => {
    return new Promise((resolve, reject) => {
        const { app, router } = createApp()
        // 添加首屏渲染的地址
        router.push(context.url)
        router.onReady(() => {
            resolve(app)
        }, () => {
            reject('首屏渲染错误')
        })
    })
}